<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'image-ads-form',
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'enctype' => 'multipart/form-data'
    ),
    'action' => array('/ad/imageads/create'),
    'type' => 'horizontal'
        ))
?>

<?php echo $form->errorSummary($model) ?>

<div>

    <label>Link</label> <br/>

    <?php echo $form->textField($model, 'url') ?>

    <?php echo $form->error($model, 'url') ?>

</div>



<div>

    <label>Image</label> <br/>

    <?php echo CHtml::activeFileField($model, 'photo') ?>

    <?php echo $form->error($model, 'image') ?>



    <?php
    if ($model->image != '')
        echo '<img src="' . Yii::app()->baseUrl . '/uploads/' . $model->image . '" alt="image"/>'
        ?>



    <?php echo $form->hiddenField($model, 'image') ?>

</div>



<div>

    <label>Select location</label><br/>

    <?php
    echo $form->dropDownList($model, 'position', array(
        'right' => 'Right sidebar',
        'left' => 'Left sidebar',
        'bottom' => 'Bottom',
        'top' => 'Top'
    ))
    ?>

</div> <br/>


<br/>

<div>

    <input type="submit" value="Submit" />

</div>



<?php $this->endWidget() ?>